// Generated Lexer forward declares 
// iostream members, but not in namespace std
// so we do it here so we can beat it to the punch
// as some reference are before the user defines section

#include "stdafx.h"
#include <iostream>

using namespace std;

using std::istream;
using std::ostream;
using std::cin;
using std::cout;
using std::cerr;

// lexer includes unistd.h, which doesn't exist in VS
// so we substitute it for an empty file
#ifdef _MSC_VER
#pragma include_alias(<unistd.h>, <empty.h>)
#endif

#include <cstdlib>

#include "Lexer.cpp"

// this is implemented here as it requires the definition of the yy_buffer_state struct
// which is defined in Lexer.cpp, after the user defines section
ULONG_PTR GetCharsLeftInBuffer(const char* yytext, const yy_buffer_state* buffer)
{
    // return chars in buffer - (currentPos - start)
    return buffer->yy_n_chars - (yytext - buffer->yy_buf_pos);
}
